1. Field of the Invention
The present invention relates to a method and an apparatus for obtaining a composite image by laying out a plurality of images, and to a method and an apparatus for obtaining a composite image by using an image and a template. The present invention also relates to a computer-readable recording medium storing programs to cause a computer to execute these composite-image generation methods and to a computer-readable recording medium storing template data representing the template.
2. Description of the Related Art
Services such as generating a picture postcard for a new year's greeting by using a template comprising text and an illustration for the greeting and a blank space for inserting a photograph have been carried out. In order to generate such a postcard, a user brings an original image recorded on a negative film or the like to a DPE store and the DPE store converts the original image into digital image data. By composing the digital image data with template data representing a text position and a template, composite image data are obtained. The postcard is generated by printing a composite image based on the composite image data.
A template is defined as an image having RGBα channels, and printing is carried out after the composite image has been generated by inserting an image of a user or the like in the template or combining the image with the template. In this case, if a position of image insertion is specified in the template, the original image of the user's own can be added to a high-quality image generated by a designer, through image replacement.
The α channel is a channel for defining transparency of the image at a pixel position. Depending on a value of the α channel, a composition ratio between the image to be inserted and the template is changed. More specifically, the smaller the value of the α channel is, the more transparent the image of the template becomes. For example, by decreasing the value of the α channel near a boundary between the image to be inserted and the template, the image is composed with the template in such a manner that the image appears to be blended with the template. Therefore, if the α channel defines the transparency, a user image can be blended with the template and composition of the template and the image looks natural.
However, a conventional template is used for generating a composite image by inserting a user image in the template having a background predetermined in a laboratory. Therefore, a composite image having a background desired by a user cannot be generated.
Furthermore, if a conventional template is used, generation of a composite image followed by subsequent image processing by using another image processing apparatus is necessary in order to insert a user image reflected in a base image of the template or in order to carry out image processing such as adding a wavy pattern, since the conventional template is used only for insertion of the user image into the base image. Therefore, processing for generating the composite image is complicated.
Moreover, if there are two neighboring areas for image insertion in a template as shown in FIG. 47(a) and if an image to be inserted in one of the areas is larger than the area, the image extends beyond the area and partially covers the other area as shown in FIG. 47(b), since only one α channel is defined in the conventional template data.